Skip to content

[TypeDeclarationDocblocks] Skip multiple returns on AddReturnDocblockForCommonObjectDenominatorRector#7250

Merged
samsonasik merged 2 commits intomainfrom
skip-multiple-returns
Sep 12, 2025
Merged

[TypeDeclarationDocblocks] Skip multiple returns on AddReturnDocblockForCommonObjectDenominatorRector#7250
samsonasik merged 2 commits intomainfrom
skip-multiple-returns

Conversation

@samsonasik
Copy link
Member

The rule only add docblock when returns only 1. Current behaviour is invalid.

 final class SkipMultipleReturns
 {
+    /**
+     * @return \Rector\Tests\TypeDeclarationDocblocks\Rector\ClassMethod\AddReturnDocblockForCommonObjectDenominatorRector\Source\Contract\ExtensionInterface[]
+     */
     public function getExtensions(): array
     {
        if (rand(0, 1)) {
            return [
                new FirstExtension(),
                new SecondExtension()
            ];
        }

        return ['string'];
     }

Ref #7249 (review)

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @TomasVotruba

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit 15fbd08 into main Sep 12, 2025
49 checks passed
@samsonasik samsonasik deleted the skip-multiple-returns branch September 12, 2025 10:01
@github-actions
Copy link
Contributor

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant